﻿// ===============================================================================
// MarkupTest.cs
// EOS Web Framework
// ===============================================================================
// Copyright (c) EOS Development Group. All rights reserved.
// ===============================================================================

namespace EOS.Framework.Web.Mvc.Tests
{
    using System.Xml;
    using EOS.Framework.Kernel;
    using EOS.Framework.Web.Mvc;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// This is a test class for MarkupTest and is intended
    /// to contain all MarkupTest Unit Tests
    /// </summary>
    [TestClass()]
    public class MarkupTest
    {
        private TestContext testContextInstance;

        /// <summary>
        /// Gets or sets the test context which provides
        /// information about and functionality for the current test run.
        /// </summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        /// <summary>
        /// A test for RenderMarkup
        /// </summary>
        [TestMethod()]
        public void RenderMarkupTest()
        {
            Unity.Current.RegisterType<IMarkupCache, MarkupCache>();

            string testXml = "<html xmlns:mvc=\"http://eos.de\"><head mvc:id=\"test\"></head><body></body></html>";

            XmlDocument doc = new XmlDocument();
            doc.LoadXml(testXml);

            Markup markup = new Markup(doc);

            XhtmlWriter writer = new XhtmlWriter();
            markup.RenderMarkup(writer, null);

            string output = writer.Flush();
        }
    }
}
